package com.ruoyi.web.controller.sequence;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.construction.RentalService;
import com.ruoyi.system.service.construction.RentalServiceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/system/zulin")
public class ZuLinController extends BaseController {

    @Autowired
    private RentalServiceService rentalServiceService;

    @GetMapping("/zulinList")
    public TableDataInfo zulinList(RentalService rentalService){
        startPage();
        List<RentalService> list= rentalServiceService.zulinList(rentalService);
        return getDataTable(list);
    }

    @GetMapping(value = "/zulinId/{rentalId}")
    public AjaxResult getInfo(@PathVariable("rentalId") Integer rentalId)
    {
        return AjaxResult.success(rentalServiceService.selectRentalServiceById(rentalId));
    }

    @PutMapping(value = "/zuLinEdit")
    public AjaxResult edit(@RequestBody RentalService rentalService)
    {
        return toAjax(rentalServiceService.updateRentalService(rentalService));
    }

}
